%html
	%head 
		%title My BLog
	%body
		%h1 My Blog
		-if @blog_posts.length ==0
			%p= "Sorry, there is no posts to display. Post a new one using the link below!"
		-else
			- @blog_posts.each do |blog_post|
				%p{style: "color:red;"}
					%b= link_to blog_post.title, blog_post

     
				%p= blog_post.content
				%p{style: "float: right;"}
					= link_to "Delete", blog_post, method: :delete, confirm: "Are you sure you want to delete this post?"
				%p{style: "clear: both; float: right; margin-top: -10px"}
					= link_to 'Edit',edit_blog_post_path(blog_post)
				%hr{style: "clear: both;"}
		%br
		= link_to 'New Post',new_blog_post_path